package com.ruoyi.base.service.impl;

import java.util.Date;
import java.util.List;
import java.util.UUID;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.base.mapper.BasWatergateMapper;
import com.ruoyi.base.domain.BasWatergate;
import com.ruoyi.base.service.IBasWatergateService;

/**
 * 闸口Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-07-27
 */
@Service
public class BasWatergateServiceImpl implements IBasWatergateService 
{
    @Autowired
    private BasWatergateMapper basWatergateMapper;

    /**
     * 查询闸口
     * 
     * @param ID 闸口主键
     * @return 闸口
     */
    @Override
    public BasWatergate selectBasWatergateByID(String ID)
    {
        return basWatergateMapper.selectBasWatergateByID(ID);
    }

    /**
     * 查询闸口列表
     * 
     * @param basWatergate 闸口
     * @return 闸口
     */
    @Override
    public List<BasWatergate> selectBasWatergateList(BasWatergate basWatergate)
    {
        return basWatergateMapper.selectBasWatergateList(basWatergate);
    }

    /**
     * 新增闸口
     * 
     * @param basWatergate 闸口
     * @return 结果
     */
    @Override
    public int insertBasWatergate(BasWatergate basWatergate)
    {
        basWatergate.setId(UUID.randomUUID().toString());
        basWatergate.setUpdatetime(new Date());
        return basWatergateMapper.insertBasWatergate(basWatergate);
    }

    /**
     * 修改闸口
     * 
     * @param basWatergate 闸口
     * @return 结果
     */
    @Override
    public int updateBasWatergate(BasWatergate basWatergate)
    {
        basWatergate.setUpdatetime(new Date());
        return basWatergateMapper.updateBasWatergate(basWatergate);
    }

    /**
     * 批量删除闸口
     * 
     * @param IDs 需要删除的闸口主键
     * @return 结果
     */
    @Override
    public int deleteBasWatergateByIDs(String[] IDs)
    {
        return basWatergateMapper.deleteBasWatergateByIDs(IDs);
    }

    /**
     * 删除闸口信息
     * 
     * @param ID 闸口主键
     * @return 结果
     */
    @Override
    public int deleteBasWatergateByID(String ID)
    {
        return basWatergateMapper.deleteBasWatergateByID(ID);
    }
}
